package com.ggk911.pharmacy_system.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ggk911.pharmacy_system.entity.DrugInfoType;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author ggk-911
 * @version 1.0 2023/3/19 18:36
 */
@Repository
public interface DrugInfoTypeMapper extends BaseMapper<DrugInfoType> {
    /**
     * 增强查询
     *
     * @param id
     * @return
     */
    DrugInfoType selectByIdAd(Integer id);

    /**
     * 重写的selectPage方法
     *
     * @param page
     * @param queryWrapper
     * @param <P>
     * @return
     */
    @Override
    <P extends IPage<DrugInfoType>> P selectPage(P page, @Param("ew") Wrapper<DrugInfoType> queryWrapper);

    @Override
    List<DrugInfoType> selectList(@Param("ew") Wrapper<DrugInfoType> queryWrapper);

    int getDrugInfoTypeIdByDrugInfoTypeName(String name);
}
